#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@protocol MCUTableSection<NSObject>

/*!  * @brief 子分段个数 */
- (NSInteger)numberOfSections;

/*!  * @brief 某个子分段的元素个数
 *  @param section 表格分段索引
 *  @param relsection 相对section索引
 */
- (NSInteger)numberOfRows:(NSNumber *)section relsection:(NSNumber *)relsection;

/*!  * @brief 获取元素高度
 * @param relsection 相对section索引
 */
- (CGFloat)heightForCell:(NSIndexPath *)indexPath relsection:(NSNumber *)relsection;

/*!  * @brief 元素高度自动缩放，需要适配大屏，有些元素高度要成倍调整的，返回TRUE
 * @param relsection 相对section索引
 */
- (BOOL)cellAutoScale:(NSIndexPath *)indexPath relsection:(NSNumber *)relsection;

/*!  * @brief 获取表格元素
 * @param relsection 相对section索引
 */
- (UITableViewCell *)cellForRowAtIndex:(NSIndexPath *)indexPath relsection:(NSNumber *)relsection;

/*!  * @brief 获取子分段高度
 * @param relsection 相对section索引
 */
- (CGFloat)heightForHeader:(NSNumber *)section relsection:(NSNumber *)relsection;

/*!  * @brief
 * 子分段头部高度自动缩放，需要适配大屏，有些元素高度要成倍调整的，返回TRUE
 * @param relsection 相对section索引
 */
- (BOOL)headerAutoScale:(NSNumber *)section relsection:(NSNumber *)relsection;

/*!  * @brief 获取子分段头部视图
 * @param relsection 相对section索引
 */
- (UIView *)headerView:(NSNumber *)section relsection:(NSNumber *)relsection;

/*!  * @brief 子分段脚部视图高度
 * @param relsection 相对section索引
 */
- (CGFloat)heightForFooter:(NSNumber *)section relsection:(NSNumber *)relsection;

/*!  * @brief
 * 子分段脚部高度自动缩放，需要适配大屏，有些元素高度要成倍调整的，返回TRUE
 * @param relsection 相对section索引
 */
- (BOOL)footerAutoScale:(NSNumber *)section relsection:(NSNumber *)relsection;

/*!  * @brief 子分段脚部视图
 * @param relsection 相对section索引
 */
- (UIView *)footerView:(NSNumber *)section relsection:(NSNumber *)relsection;

/*!  * @brief 元素选择
 * @param relsection 相对section索引
 */
- (void)cellSelected:(NSIndexPath *)indexPath relsection:(NSNumber *)relsection;

/*!  * @brief 取消选择元素
 * @param relsection 相对section索引
 */
- (void)cellDeselected:(NSIndexPath *)indexPath relsection:(NSNumber *)relsection;

/*!  * @brief 元素编辑样式
 * @param relsection 相对section索引
 */
- (UITableViewCellEditingStyle)editingStyle:(NSIndexPath *)indexPath
                                 relsection:(NSNumber *)relsection;

/*!  * @brief 用户提交编辑
 * @param relsection 相对section索引
 */
- (void)commitEditing:(NSIndexPath *)indexPath relsection:(NSNumber *)relsection;

/*!  * @brief 设置tableviewCell左划删除按钮文字
 * @param relsection 相对section索引
 */
- (NSString *)titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
                                                     relsection:(NSNumber *)relsection;

@end

@interface MCUTableCustomSection : NSObject<MCUTableSection>

/*!  * @brief 目标对象 */
@property(weak, nonatomic) id target;

/*!  * @brief 子分段数
 *  (NSNumber*) section
 * @return 类型要求是 NSNumber, 如果不指定该Selector，默认返回1个
 */
@property(assign, nonatomic) SEL numberOfSectionSelector;

/*!  * @brief 子分段元素个数
 *  (NSNumber*) section
 * @return 类型要求是 NSNumber, 如果不指定该Selector, 默认返回1个
 */
@property(assign, nonatomic) SEL numberOfRowsSelector;

/*!  * @brief 元素视图高度
 *  (NSIndexPath*) indexPath
 * @return 类型要求是 NSNumber 类型
 */
@property(assign, nonatomic) SEL heightForCellSelector;

/*!  * @brief 元素视图高度比例
 *  (NSIndexPath*) indexPath
 * @return 类型要求是 NSNumber YES,NO类型
 */
@property(assign, nonatomic) SEL cellAutoScaleSelector;

/*!  * @brief 元素视图
 *  (NSIndexPath*) indexPath
 * @return 类型要求是 UITableViewCell
 */
@property(assign, nonatomic) SEL cellForRowAtIndexSelector;

/*!  * @brief 子分段头部高度
 *  (NSNumber*) section
 * @return 类型要求是 NSNumber 类型
 */
@property(assign, nonatomic) SEL heightForHeaderSelector;

/*!  * @brief 子分段头部高度比例
 *  (NSNumber*) section
 * @return 类型要求是 NSNumber YES,NO类型
 */
@property(assign, nonatomic) SEL headerAutoScaleSelector;

/*!  * @brief 子分段头部视图
 * (NSNumber*) section
 * @return 类型要求是 UIView 类型
 */
@property(assign, nonatomic) SEL headerViewSelector;

/*!  * @brief 子分段脚部高度
 *  (NSNumber*) section
 * @return 类型要求是 NSNumber 类型
 */
@property(assign, nonatomic) SEL heightForFooterSelector;

/*!  * @brief 子分段脚部高度比例
 *  (NSNumber*) section
 * @return 类型要求是 NSNumber YES,NO类型
 */
@property(assign, nonatomic) SEL footerAutoScaleSelector;

/*!  * @brief 子分段脚部视图
 *  (NSNumber*) section
 * @return 类型要求是 UIView 类型
 */
@property(assign, nonatomic) SEL footerViewSelector;

/*!  * @brief 元素选中
 *  (NSIndexPath*) indexPath
 * @return void
 */
@property(assign, nonatomic) SEL cellSelectedSelector;

/*!  * @brief 元素取消选中
 *  (NSIndexPath*) indexPath
 * @return void
 */
@property(assign, nonatomic) SEL cellDeselectedSelector;

/*!  * @brief 编辑样式
 *  (NSIndexPath*) indexPath
 * @return 类型要求是 NSNumber 类型
 */
@property(assign, nonatomic) SEL editingStyleSelector;

/*!  * @brief 提交编辑
 *  (NSIndexPath*) indexPath
 * @return void
 */
@property(assign, nonatomic) SEL commitEditingSelector;

/*!  * @brief 设置tableviewCell左划删除按钮文字  (NSIndexPath*) indexPath
 * @return NSString
 */
@property(assign, nonatomic) SEL titleForDeleteConfirmationButtonSelector;

/*!  * @brief 绑定一个目标对象
 * @param target 任何NSObject对象
 */
- (id)initWithTarget:(id)target;

/*!  * @brief 创建并绑定一个目标对象 */
+ (id)createWithTarget:(id)target;

@end
